package com.lluohao.web.controller;

import com.lluohao.service.IMessageService;
import com.lluohao.service.impl.MessageServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;

@Controller
public class TellController {
    private IMessageService service = new MessageServiceImpl();
    @RequestMapping(value = "/tell", produces = "application/json; charset=utf-8")
    public @ResponseBody String tell(MessageVO m, HttpServletResponse response){
        response.setCharacterEncoding("utf-8");
        String str = service.handler(m);
        System.out.println(m.getMsg());
        System.out.println(str);
        return str;
    }
}
